package ar.com.muebleria.view;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JPanel;
import org.apache.log4j.Logger;
import ar.com.muebleria.util.BeanFactory;

public class Evento implements ActionListener {

	private static final long serialVersionUID = -9129517295288567746L;
	private String clase;
	private JPanel jContentPane;

	public Evento(String clase, JPanel jContentPane) {
		super();
		this.clase = clase;
		this.jContentPane = jContentPane;
	}

	@Override
	public void actionPerformed(ActionEvent e) {  
		try {
			this.jContentPane.add(BeanFactory.getInstancia(this.clase));
		} catch (Exception e1) {
			Logger.getLogger("ActionListener").error(e);
		}
	}

}
